package com.desaysv.wandroid.adapter

import android.content.Context
import com.desaysv.svview.adapter.BaseRecycleAdapter
import com.desaysv.wandroid.R

/**
 * @author linzi
 * @date 2022-11-17
 */
class MenuAdapter(context: Context?) : BaseRecycleAdapter() {
    private val context: Context? = context
    private val icons= intArrayOf(R.drawable.icon_menu_usage,R.drawable.icon_menu_nav,R.drawable.icon_menu_search,R.drawable.icon_menu_setup,R.drawable.icon_menu_manager)
    private val menus= arrayOf("常用","导航","热词","体系","项目")

    override fun setContext(): Context {
        return context!!
    }

    override fun setView(): Int {
        return R.layout.layout_menus
    }

    override fun setSize(): Int {
        return icons.size
    }

    override fun bind(item: HolderProxy, position: Int) {
        item.setText(R.id.tvTitle,menus[position])
        item.setBackground(R.id.ivIcon,icons[position])
    }
}